//引入路由
import { createRouter, createWebHashHistory } from "vue-router";
//引入页面
const Home = () => import('../views/Home.vue')
const About = () => import('../views/About.vue')

//路由配置
const routes = [
    {path:'/', redirect:'/home'},
    {path:'/home', component: Home},
    {path:'/about', component: About},
]

//创建路由实例
const router = createRouter({
    //使用 hash模式
    history: createWebHashHistory(),
    //传入路由配置
    routes,
})
export default router